package com.isunland.managesystem.entity;

import android.content.Context;
import android.text.TextUtils;
import com.isunland.managesystem.R;

/**
 * 对象功能:
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 * 创建时间: 2017/4/12 13:13
 */

public class PayAndBackParams extends BaseParams {
  /** 保证金 */
  public static final String MONEY_TYPE_GARRENTEE_FEE = "1";
  /** 押金 */
  public static final String MONEY_TYPE_ANTECEDENT_FEE = "2";
  /** 定金 */
  public static final String MONEY_TYPE_DEPOSIT_FEE = "3";
  /** 违约金 */
  public static final String MONEY_TYPE_DEBIT_FEE = "4";
  /** 租赁费 */
  public static final String MONEY_TYPE_LEASE_FEE = "5";
  /** 作业任务 */
  public static final String ORDER_TYPE_LOCALE_WORK = "work";
  /** 租赁订单 */
  public static final String ORDER_TYPE_LEASE = "lease";
  /** 预约订单 */
  public static final String ORDER_TYPE_ORDER = "order";
  public static final String TYPE_DETAIL = "detail";
  /** 主表id */
  private String mainId;
  /** 支付金额,用逗号拼接 */
  private String payMuch;
  /** moenyType金金额类型（1.保障金2.押金3.定金4.违约金5.租赁费）（逗号分隔）（数据字典：moneytype）,预约订单1,租赁订单2,5,作业任务3. */
  private String moneyType;
  /** 结算类型（work-任务作业,lease-设备租赁,order-预约接单）（数据字典：paybilltype） */
  private String orderType;
  /** 主记录编码,订单的是bookNo租赁的是leaseNo，现场作业是 负责人-作业开始时间（XXX-2017-03-01） */
  private String bookOrderNo;

  /** 类型,用于区别详情界面结束界面,否则不结束. */
  private String pageType;

  public void setEditable(boolean editable) {
    this.editable = editable;
  }

  /** 是否可编辑,如果是多条逗号分隔的这种,不可编辑,否则没法传值了 */
  private boolean editable;

  public String getPageType() {
    return pageType;
  }

  public void setPageType(String type) {
    this.pageType = type;
  }

  public String getBookOrderNo() {
    return bookOrderNo;
  }

  public String getMainId() {
    return mainId;
  }

  public void setMainId(String mainId) {
    this.mainId = mainId;
  }

  public String getPayMuch() {
    return payMuch;
  }

  public void setPayMuch(String payMuch) {
    this.payMuch = payMuch;
  }

  public String getMoneyType() {
    return moneyType;
  }

  public void setMoneyType(String moneyType) {
    this.moneyType = moneyType;
  }

  public String getOrderType() {
    return orderType;
  }

  public void setOrderType(String orderType) {
    this.orderType = orderType;
  }

  public void setBookOrderNo(String bookOrderNo) {
    this.bookOrderNo = bookOrderNo;
  }

  public boolean isEditable() {
    return editable;
  }

  public String getOrderTypeName(Context context) {
    if (TextUtils.isEmpty(orderType) || context == null) return "";
    switch (orderType) {
      case ORDER_TYPE_LOCALE_WORK:
        return context.getString(R.string.operationTask);
      case ORDER_TYPE_ORDER:
        return context.getString(R.string.appointmentOrder2);
      case ORDER_TYPE_LEASE:
        return context.getString(R.string.leaseEquip);
      default:
        return "";
    }
  }
}
